package com.example.ioc.userController;

import com.example.ioc.model.DbTypes;
import com.example.ioc.model.Student;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController()
@RequestMapping("/read")
public class readymlController {
    @Value("${server.port}")
    private int port;
    @Value("${string.str1}")
    private String str1;
    @Value("${string.str2}")
    private String str2;
    @Value("${string.str3}")
    private String str3;
    @Autowired
    private Student s;
    @Autowired
    private DbTypes dbTypes;
    @RequestMapping("/readyml1")
    public String readyml1() {
        return "读取到yml:" + port;
    }
    @RequestMapping("/readyml2")
    public String readyml2() {
        return "读取到yml:" + str1 + str2 + str3;
    }
    @RequestMapping("/readyml3")
    public String readyml3() {
        return s.toString();
    }
    @RequestMapping("/readyml4")
    public String readyml4() {
        return dbTypes.toString();
    }
}
